package com.example.demo.controller;

import com.example.demo.Mappers.WxBillMapper;
import com.example.demo.beans.GetLisInfoRequest;
import com.example.demo.beans.WxBilResponse;
import com.example.demo.beans.WxBillBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2018-11-18.
 */
@RestController
public class WxBillController {
    @Autowired
    private WxBillMapper mapper;
  @ResponseBody
    @RequestMapping(value = "WxBill",produces = "application/xml")
    public WxBilResponse getWxBill(@RequestBody(required = false)GetLisInfoRequest request)
  { WxBilResponse response =new WxBilResponse();
      if(request!=null)
  {
      List<WxBillBean> list=mapper.GetWxBillBean(request.getStartDate(),request.getEndDate());
      response.setResultCode("0");
      response.setResultMsg("查询成功");
      response.setItem(list);
      return  response;

  }
    else {
          response.setResultCode("1");
          response.setResultMsg("您传入的参数为空，请检查！");
          return  response;
      }

  }

}
